package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDTO;
import com.heima.model.article.pojos.ApArticle;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;


public interface ApArticleMapper extends BaseMapper<ApArticle> {
    List<ApArticle> getArticleList(@Param("loadType") Short loadType, @Param("dto") ArticleHomeDTO dto);

    @Select("select aa.* from ap_article aa left join ap_article_config aac on aa.id = aac.article_id where aa.publish_time > #{date} and aac.is_down = 0 and aac.is_delete = 0")
    List<ApArticle> getArticleListLast5Days(@Param("date") Date date);
}